<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>找出数组内最⼤的素数</title>
</head>
<body>
    
</body>
</html>
<script>
    //素数是除了1和它自身外，不能被其它自然数整除的数
    var arr = [1,2,3,2,0,2,4,8,9,22,24,23];
    var obj = arr[0];
    for(var i=0;i<arr.length;i++){
        if(arr[i]>obj){
            obj = arr[i];
        }
    }
    console.log(obj);
</script>